home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume2 / x11.3 / patch4 < prev    next >
Encoding:
Internet Message Format  |  1989-01-09  |  25.8 KB

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v02i080:  X11 Release 3, Patch4
  5. Message-ID: <1975@wyse.wyse.com>
  6. Date: 10 Jan 89 01:40:49 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 958
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: jim@expo.lcs.mit.edu (Jim Fulton)
  12. Posting-number: Volume 2, Issue 80
  13. Archive-name: x11.3/patch4
  14.  
  15.  
  16. [Here is a corrected version of the patch.  Don't apply the earlier
  17. one. -mcw]
  18.  
  19.  
  20.                Created on Monday, 9 January 1989
  21.      [The original fix4 was created against the wrong revisions.]
  22.  
  23.  
  24. This patch fixes problems in the following files:
  25.  
  26.   clients/xterm/Imakefile       add comment about -DWTMP and -DLASTLOG
  27.   clients/xterm/Tekproc.c       fix menu action problems that abort xterm
  28.   clients/xterm/VTPrsTbl.c      added support for DECID sequence ESC Z
  29.   clients/xterm/VTparse.def     added support for DECID sequence ESC Z
  30.   clients/xterm/VTparse.h       added support for DECID sequence ESC Z
  31.   clients/xterm/button.c        fixed extend selection bugs and core dump
  32.   clients/xterm/charproc.c      ESC Z and pointer escape sequences
  33.   clients/xterm/main.c          utmp bug and optional WTMP and LASTLOG
  34.   clients/xterm/misc.c          fix error message and cleanup
  35.   clients/xterm/screen.c        fix resizing window with selection bug
  36.   clients/xterm/scrollbar.c    fix incorrect use of do_not_propagate_mask
  37.   clients/xterm/xterm.man       no longer using vtsingle or vtbold
  38.  
  39.  
  40. Apply these fixes from the top of your X sources as follows:
  41.  
  42.         %  patch -p0 <fix4
  43.  
  44.  
  45. *** /tmp/,RCSt1a26454    Mon Jan  9 11:19:44 1989
  46. --- clients/xterm/Imakefile    Mon Jan  9 11:19:44 1989
  47. ***************
  48. *** 24,29 ****
  49. --- 24,30 ----
  50.   #else
  51.   #define GettyProgram /* as nothing */
  52.   #endif
  53. + /* add -DWTMP and -DLASTLOG if you want them */
  54.           DEFINES = -DMODEMENU -DUTMP -DBcopy=bcopy GettyProgram
  55.             SRCS1 = button.c charproc.c cursor.c data.c input.c \
  56.             main.c menu.c misc.c screen.c scrollbar.c tabs.c \
  57. *** /tmp/,RCSt1a26508    Mon Jan  9 11:19:57 1989
  58. --- clients/xterm/Tekproc.c    Mon Jan  9 11:19:59 1989
  59. ***************
  60. *** 1,5 ****
  61.   /*
  62. !  * $XConsortium: Tekproc.c,v 1.44 88/11/16 13:45:06 rws Exp $
  63.    *
  64.    * Warning, there be crufty dragons here.
  65.    */
  66. --- 1,5 ----
  67.   /*
  68. !  * $XConsortium: Tekproc.c,v 1.47 89/01/04 12:01:34 jim Exp $
  69.    *
  70.    * Warning, there be crufty dragons here.
  71.    */
  72. ***************
  73. *** 121,127 ****
  74.   #define    unput(c)    *Tpushback++ = c
  75.   
  76.   #ifndef lint
  77. ! static char rcs_id[] = "$XConsortium: Tekproc.c,v 1.44 88/11/16 13:45:06 rws Exp $";
  78.   #endif    /* lint */
  79.   
  80.   static XPoint *T_box[TEKNUMFONTS] = {
  81. --- 121,127 ----
  82.   #define    unput(c)    *Tpushback++ = c
  83.   
  84.   #ifndef lint
  85. ! static char rcs_id[] = "$XConsortium: Tekproc.c,v 1.47 89/01/04 12:01:34 jim Exp $";
  86.   #endif    /* lint */
  87.   
  88.   static XPoint *T_box[TEKNUMFONTS] = {
  89. ***************
  90. *** 679,685 ****
  91.       register int border = 2 * screen->border;
  92.       register double d;
  93.   
  94. !     XClearWindow(screen->display, TWindow(screen));
  95.       TWidth(screen) = w->core.width - border;
  96.       THeight(screen) = w->core.height - border;
  97.       TekScale(screen) = (double)TWidth(screen) / TEKWIDTH;
  98. --- 679,685 ----
  99.       register int border = 2 * screen->border;
  100.       register double d;
  101.   
  102. !     if (TWindow(screen)) XClearWindow(screen->display, TWindow(screen));
  103.       TWidth(screen) = w->core.width - border;
  104.       THeight(screen) = w->core.height - border;
  105.       TekScale(screen) = (double)TWidth(screen) / TEKWIDTH;
  106. ***************
  107. *** 1166,1173 ****
  108.       if ((XValue&pr) || (YValue&pr))
  109.         sizehints.flags |= USSize|USPosition;
  110.       else sizehints.flags |= PSize|PPosition;
  111. !     tw->core.width = sizehints.width = width;
  112. !     tw->core.height = sizehints.height = height;
  113.       if ((WidthValue&pr) || (HeightValue&pr))
  114.         sizehints.flags |= USSize;
  115.       else sizehints.flags |= PSize;
  116. --- 1166,1173 ----
  117.       if ((XValue&pr) || (YValue&pr))
  118.         sizehints.flags |= USSize|USPosition;
  119.       else sizehints.flags |= PSize|PPosition;
  120. !     sizehints.width = width;
  121. !     sizehints.height = height;
  122.       if ((WidthValue&pr) || (HeightValue&pr))
  123.         sizehints.flags |= USSize;
  124.       else sizehints.flags |= PSize;
  125. ***************
  126. *** 1305,1310 ****
  127. --- 1305,1311 ----
  128.       tek->count = 0;
  129.       tek->ptr = tek->data;
  130.       Tpushback = Tpushb;
  131. +     Tbptr = Tbuffer;
  132.       screen->cur_X = 0;
  133.       screen->cur_Y = TEKHOME;
  134.       line_pt = Tline;
  135. *** /tmp/,RCSt1a26543    Mon Jan  9 11:20:07 1989
  136. --- clients/xterm/VTPrsTbl.c    Mon Jan  9 11:20:08 1989
  137. ***************
  138. *** 1,5 ****
  139.   /*
  140. !  *    $XConsortium: VTPrsTbl.c,v 1.2 88/09/06 17:07:40 jim Exp $
  141.    */
  142.   
  143.   
  144. --- 1,5 ----
  145.   /*
  146. !  *    $XConsortium: VTPrsTbl.c,v 1.3 89/01/04 13:37:41 jim Exp $
  147.    */
  148.   
  149.   
  150. ***************
  151. *** 29,41 ****
  152.    */
  153.   
  154.   #ifndef lint
  155. ! static char *rcsid_VTparsetable_c = "$XConsortium: VTPrsTbl.c,v 1.2 88/09/06 17:07:40 jim Exp $";
  156.   #endif    /* lint */
  157.   
  158.   #include "VTparse.h"
  159.   #ifndef lint
  160. ! static char rcs_id[] = "$XConsortium: VTPrsTbl.c,v 1.2 88/09/06 17:07:40 jim Exp $";
  161.   #endif    /* lint */
  162.   /*
  163.    * Stupid Apollo C preprocessor can't handle long lines.  So... To keep
  164.    * it happy, we put each onto a seperate line....  Sigh...
  165. --- 29,42 ----
  166.    */
  167.   
  168.   #ifndef lint
  169. ! static char *rcsid_VTparsetable_c = "$XConsortium: VTPrsTbl.c,v 1.3 89/01/04 13:37:41 jim Exp $";
  170.   #endif    /* lint */
  171.   
  172.   #include "VTparse.h"
  173.   #ifndef lint
  174. ! static char rcs_id[] = "$XConsortium: VTPrsTbl.c,v 1.3 89/01/04 13:37:41 jim Exp $";
  175.   #endif    /* lint */
  176.   /*
  177.    * Stupid Apollo C preprocessor can't handle long lines.  So... To keep
  178.    * it happy, we put each onto a seperate line....  Sigh...
  179. ***************
  180. *** 807,813 ****
  181.   /*    X        Y        Z        [    */
  182.   CASE_GROUND_STATE,
  183.   CASE_GROUND_STATE,
  184. ! CASE_GROUND_STATE,
  185.   CASE_CSI_STATE,
  186.   /*    \        ]        ^        _    */
  187.   CASE_GROUND_STATE,
  188. --- 808,814 ----
  189.   /*    X        Y        Z        [    */
  190.   CASE_GROUND_STATE,
  191.   CASE_GROUND_STATE,
  192. ! CASE_DECID,
  193.   CASE_CSI_STATE,
  194.   /*    \        ]        ^        _    */
  195.   CASE_GROUND_STATE,
  196. *** /tmp/,RCSt1a26559    Mon Jan  9 11:20:14 1989
  197. --- clients/xterm/VTparse.def    Mon Jan  9 11:20:15 1989
  198. ***************
  199. *** 1,5 ****
  200.   #
  201. ! # $XConsortium: VTparse.def,v 1.2 88/09/06 14:35:13 jim Exp $
  202.   #
  203.   # List of symbols that need to be defined for VTparse.h.  If you need to 
  204.   # change any of the CASE_ macros, make the change here and rerun the command
  205. --- 1,5 ----
  206.   #
  207. ! # $XConsortium: VTparse.def,v 1.3 89/01/04 13:37:48 jim Exp $
  208.   #
  209.   # List of symbols that need to be defined for VTparse.h.  If you need to 
  210.   # change any of the CASE_ macros, make the change here and rerun the command
  211. ***************
  212. *** 73,75 ****
  213. --- 73,76 ----
  214.   CASE_XTERM_SAVE
  215.   CASE_XTERM_RESTORE
  216.   CASE_XTERM_TITLE
  217. + CASE_DECID
  218. *** /tmp/,RCSt1a26576    Mon Jan  9 11:20:17 1989
  219. --- clients/xterm/VTparse.h    Mon Jan  9 11:20:19 1989
  220. ***************
  221. *** 1,5 ****
  222.   /*
  223. !  *    $XConsortium: VTparse.h,v 1.3 88/09/06 17:07:45 jim Exp $
  224.    */
  225.   
  226.   
  227. --- 1,5 ----
  228.   /*
  229. !  *    $XConsortium: VTparse.h,v 1.4 89/01/04 13:37:49 jim Exp $
  230.    */
  231.   
  232.   
  233. ***************
  234. *** 109,111 ****
  235. --- 109,112 ----
  236.   #define CASE_XTERM_SAVE 64
  237.   #define CASE_XTERM_RESTORE 65
  238.   #define CASE_XTERM_TITLE 66
  239. + #define CASE_DECID 67
  240. *** /tmp/,RCSt1a26604    Mon Jan  9 11:20:28 1989
  241. --- clients/xterm/button.c    Mon Jan  9 11:20:29 1989
  242. ***************
  243. *** 1,5 ****
  244.   /*
  245. !  *    $XConsortium: button.c,v 1.24 88/11/16 13:48:39 rws Exp $
  246.    */
  247.   
  248.   
  249. --- 1,5 ----
  250.   /*
  251. !  *    $XConsortium: button.c,v 1.32 89/01/05 12:47:45 swick Exp $
  252.    */
  253.   
  254.   
  255. ***************
  256. *** 35,41 ****
  257.                   J. Gettys.
  258.   */
  259.   #ifndef lint
  260. ! static char rcs_id[] = "$XConsortium: button.c,v 1.24 88/11/16 13:48:39 rws Exp $";
  261.   #endif    /* lint */
  262.   #include <X11/Xos.h>
  263.   #include <X11/Xlib.h>
  264. --- 35,41 ----
  265.                   J. Gettys.
  266.   */
  267.   #ifndef lint
  268. ! static char rcs_id[] = "$XConsortium: button.c,v 1.32 89/01/05 12:47:45 swick Exp $";
  269.   #endif    /* lint */
  270.   #include <X11/Xos.h>
  271.   #include <X11/Xlib.h>
  272. ***************
  273. *** 130,143 ****
  274.   static int replyToEmacs;
  275.   
  276.   
  277. ! static Boolean SendMousePosition(w, event)
  278.   Widget w;
  279. ! XEvent* event;            /* must be XButtonEvent* */
  280.   {
  281.       register TScreen *screen = &((XtermWidget)w)->screen;
  282.       
  283.       if (screen->send_mouse_pos == 0) return False;
  284.   
  285.   #define KeyModifiers \
  286.       (event->xbutton.state & (ShiftMask | LockMask | ControlMask | Mod1Mask | \
  287.                    Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask ))
  288. --- 130,146 ----
  289.   static int replyToEmacs;
  290.   
  291.   
  292. ! Boolean SendMousePosition(w, event)
  293.   Widget w;
  294. ! XEvent* event;
  295.   {
  296.       register TScreen *screen = &((XtermWidget)w)->screen;
  297.       
  298.       if (screen->send_mouse_pos == 0) return False;
  299.   
  300. +     if (event->type != ButtonPress && event->type != ButtonRelease)
  301. +     return False;
  302.   #define KeyModifiers \
  303.       (event->xbutton.state & (ShiftMask | LockMask | ControlMask | Mod1Mask | \
  304.                    Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask ))
  305. ***************
  306. *** 149,156 ****
  307.       switch (screen->send_mouse_pos) {
  308.         case 1: /* X10 compatibility sequences */
  309.   
  310. !     if (event->type == ButtonPress && KeyModifiers == 0) {
  311. !         EditorButton(event);
  312.           return True;
  313.       }
  314.       return False;
  315. --- 152,160 ----
  316.       switch (screen->send_mouse_pos) {
  317.         case 1: /* X10 compatibility sequences */
  318.   
  319. !     if (KeyModifiers == 0) {
  320. !         if (event->type == ButtonPress)
  321. !         EditorButton(event);
  322.           return True;
  323.       }
  324.       return False;
  325. ***************
  326. *** 196,206 ****
  327.           case RIGHTEXTENSION :
  328.               ExtendExtend(event->xmotion.x, event->xmotion.y);
  329.               break;
  330. !         default :
  331. !             /* Should get here rarely when everything
  332. !                fixed with windows and the event mgr */
  333. ! /*            fprintf(stderr, "Race mouse motion\n");
  334. ! */            break;
  335.       }
  336.   }
  337.   
  338. --- 200,208 ----
  339.           case RIGHTEXTENSION :
  340.               ExtendExtend(event->xmotion.x, event->xmotion.y);
  341.               break;
  342. !         case NORMAL :
  343. !             /* will get here if send_mouse_pos != 0 */
  344. !                 break;
  345.       }
  346.   }
  347.   
  348. ***************
  349. *** 344,349 ****
  350. --- 346,352 ----
  351.   String *params;            /* selections in precedence order */
  352.   Cardinal *num_params;
  353.   {
  354. +     if (SendMousePosition(w, event)) return;
  355.       _GetSelection(w, event->xbutton.time, params, *num_params);
  356.   }
  357.   
  358. ***************
  359. *** 503,508 ****
  360. --- 506,512 ----
  361.       TScreen *screen = &((XtermWidget)w)->screen;
  362.       int row, col, coord;
  363.   
  364. +     if (SendMousePosition(w, event)) return;
  365.       firstValidRow = 0;
  366.       lastValidRow  = screen->max_row;
  367.       SetSelectUnit(event->xbutton.time, selectUnit);
  368. ***************
  369. *** 576,595 ****
  370.   
  371.   ScrollSelection(screen, amount)
  372.   register TScreen* screen;
  373. ! int amount;
  374.   {
  375.       /* Sent by scrollbar stuff, so amount never takes selection out of
  376.          saved text */
  377.   
  378.       startRRow += amount; endRRow += amount;
  379.       startSRow += amount; endSRow += amount;
  380.       rawRow += amount;
  381.       screen->startHRow += amount;
  382.       screen->endHRow += amount;
  383.   }
  384.   
  385.   
  386. ! PointToRowCol(y, x, r, c)
  387.   register int y, x;
  388.   int *r, *c;
  389.   /* Convert pixel coordinates to character coordinates.
  390. --- 580,656 ----
  391.   
  392.   ScrollSelection(screen, amount)
  393.   register TScreen* screen;
  394. ! register int amount;
  395.   {
  396. +     register int minrow = -screen->savedlines;
  397.       /* Sent by scrollbar stuff, so amount never takes selection out of
  398.          saved text */
  399.   
  400. +     /* XXX - the preceeding is false; cat /etc/termcap (or anything
  401. +        larger than the number of saved lines plus the screen height) and then
  402. +        hit extend select */
  403.       startRRow += amount; endRRow += amount;
  404.       startSRow += amount; endSRow += amount;
  405.       rawRow += amount;
  406.       screen->startHRow += amount;
  407.       screen->endHRow += amount;
  408. +     if (startRRow < minrow) {
  409. +     startRRow = minrow;
  410. +     startRCol = 0;
  411. +     }
  412. +     if (endRRow < minrow) {
  413. +     endRRow = minrow;
  414. +         endRCol = 0;
  415. +     }
  416. +     if (startSRow < minrow) {
  417. +     startSRow = minrow;
  418. +     startSCol = 0;
  419. +     }
  420. +     if (endSRow < minrow) {
  421. +     endSRow = minrow;
  422. +     endSCol = 0;
  423. +     }
  424. +     if (rawRow < minrow) {
  425. +     rawRow = minrow;
  426. +     rawCol = 0;
  427. +     }
  428. +     if (screen->startHRow < minrow) {
  429. +     screen->startHRow = minrow;
  430. +     screen->startHCol = 0;
  431. +     }
  432. +     if (screen->endHRow < minrow) {
  433. +     screen->endHRow = minrow;
  434. +     screen->endHCol = 0;
  435. +     }
  436. +     screen->startHCoord = Coordinate (screen->startHRow, screen->startHCol);
  437. +     screen->endHCoord = Coordinate (screen->endHRow, screen->endHCol);
  438.   }
  439.   
  440.   
  441. ! ResizeSelection (screen, rows, cols)
  442. !     TScreen *screen;
  443. !     int rows, cols;
  444. ! {
  445. !     rows--;                /* decr to get 0-max */
  446. !     cols--;
  447. !     if (startRRow > rows) startRRow = rows;
  448. !     if (startSRow > rows) startSRow = rows;
  449. !     if (endRRow > rows) endRRow = rows;
  450. !     if (endSRow > rows) endSRow = rows;
  451. !     if (rawRow > rows) rawRow = rows;
  452. !     if (startRCol > cols) startRCol = cols;
  453. !     if (startSCol > cols) startSCol = cols;
  454. !     if (endRCol > cols) endRCol = cols;
  455. !     if (endSCol > cols) endSCol = cols;
  456. !     if (rawCol > cols) rawCol = cols;
  457. ! }
  458. ! static PointToRowCol(y, x, r, c)
  459.   register int y, x;
  460.   int *r, *c;
  461.   /* Convert pixel coordinates to character coordinates.
  462. ***************
  463. *** 820,829 ****
  464.       register int i, j;
  465.       GC tempgc;
  466.   
  467. !     if (frow < 0) frow = 0;
  468. !     if (trow < 0) trow = 0;
  469. !     if (frow > screen->max_row) frow = screen->max_row;
  470. !     if (trow > screen->max_row) trow = screen->max_row;
  471.       if (frow == trow && fcol == tcol)
  472.           return;
  473.   
  474. --- 881,897 ----
  475.       register int i, j;
  476.       GC tempgc;
  477.   
  478. !     if (frow < 0)
  479. !         frow = fcol = 0;
  480. !     else if (frow > screen->max_row)
  481. !         return;        /* nothing to do, since trow >= frow */
  482. !     if (trow < 0)
  483. !         return;        /* nothing to do, since frow <= trow */
  484. !     else if (trow > screen->max_row) {
  485. !         trow = screen->max_row;
  486. !         tcol = screen->max_col+1;
  487. !     }
  488.       if (frow == trow && fcol == tcol)
  489.           return;
  490.   
  491. *** /tmp/,RCSt1a26628    Mon Jan  9 11:20:38 1989
  492. --- clients/xterm/charproc.c    Mon Jan  9 11:20:42 1989
  493. ***************
  494. *** 1,5 ****
  495.   /*
  496. !  * $XConsortium: charproc.c,v 1.62 88/11/16 18:15:34 rws Exp $
  497.    */
  498.   
  499.   
  500. --- 1,5 ----
  501.   /*
  502. !  * $XConsortium: charproc.c,v 1.64 89/01/04 13:37:50 jim Exp $
  503.    */
  504.   
  505.   
  506. ***************
  507. *** 134,140 ****
  508.   #define    doinput()        (bcnt-- > 0 ? *bptr++ : in_put())
  509.   
  510.   #ifndef lint
  511. ! static char rcs_id[] = "$XConsortium: charproc.c,v 1.62 88/11/16 18:15:34 rws Exp $";
  512.   #endif    /* lint */
  513.   
  514.   static long arg;
  515. --- 134,140 ----
  516.   #define    doinput()        (bcnt-- > 0 ? *bptr++ : in_put())
  517.   
  518.   #ifndef lint
  519. ! static char rcs_id[] = "$XConsortium: charproc.c,v 1.64 89/01/04 13:37:50 jim Exp $";
  520.   #endif    /* lint */
  521.   
  522.   static long arg;
  523. ***************
  524. *** 646,651 ****
  525. --- 646,654 ----
  526.                param[3]-1, param[4]-2);
  527.               break;
  528.   
  529. +          case CASE_DECID:
  530. +             param[0] = -1;        /* Default ID parameter */
  531. +             /* Fall through into ... */
  532.            case CASE_DA1:
  533.               /* DA1 */
  534.               if (param[0] <= 0) {    /* less than means DEFAULT */
  535. ***************
  536. *** 2908,2912 ****
  537.       String *params;        /* unused */
  538.       Cardinal *param_count;    /* unused */
  539.   {
  540. !     /* do nothing */
  541.   }
  542. --- 2911,2916 ----
  543.       String *params;        /* unused */
  544.       Cardinal *param_count;    /* unused */
  545.   {
  546. !     /* do nothing, but check for funny escape sequences */
  547. !     (void) SendMousePosition(w, event);
  548.   }
  549. *** /tmp/,RCSt1a26798    Mon Jan  9 11:21:23 1989
  550. --- clients/xterm/main.c    Mon Jan  9 11:21:25 1989
  551. ***************
  552. *** 1,5 ****
  553.   #ifndef lint
  554. ! static char rcs_id[] = "$XConsortium: main.c,v 1.97 88/11/07 11:16:34 jim Exp $";
  555.   #endif    /* lint */
  556.   
  557.   /*
  558. --- 1,5 ----
  559.   #ifndef lint
  560. ! static char rcs_id[] = "$XConsortium: main.c,v 1.99 89/01/04 14:33:47 jim Exp $";
  561.   #endif    /* lint */
  562.   
  563.   /*
  564. ***************
  565. *** 102,109 ****
  566. --- 102,126 ----
  567.   #endif /* apollo */
  568.   
  569.   #include <utmp.h>
  570. + #ifdef LASTLOG
  571. + #include <lastlog.h>
  572. + #endif
  573.   #include <sys/param.h>    /* for NOFILE */
  574.   
  575. + #ifndef UTMP_FILENAME
  576. + #define UTMP_FILENAME "/etc/utmp"
  577. + #endif
  578. + #ifndef LASTLOG_FILENAME
  579. + #define LASTLOG_FILENAME "/usr/adm/lastlog"  /* only on BSD systems */
  580. + #endif
  581. + #ifndef WTMP_FILENAME
  582. + #if defined(SYSV) || defined(macII)
  583. + #define WTMP_FILENAME "/etc/wtmp"
  584. + #else
  585. + #define WTMP_FILENAME "/usr/adm/wtmp"
  586. + #endif
  587. + #endif
  588.   #include "ptyx.h"
  589.   #include "data.h"
  590.   #include "error.h"
  591. ***************
  592. *** 220,226 ****
  593.   extern void endpwent();
  594.   extern struct passwd *fgetpwent();
  595.   #else    /* not USE_SYSV_UTMP */
  596. ! static char etc_utmp[] = "/etc/utmp";
  597.   #endif    /* USE_SYSV_UTMP */
  598.   
  599.   static char *get_ty;
  600. --- 237,249 ----
  601.   extern void endpwent();
  602.   extern struct passwd *fgetpwent();
  603.   #else    /* not USE_SYSV_UTMP */
  604. ! static char etc_utmp[] = UTMP_FILENAME;
  605. ! #ifdef LASTLOG
  606. ! static char etc_lastlog[] = LASTLOG_FILENAME;
  607. ! #endif 
  608. ! #ifdef WTMP
  609. ! static char etc_wtmp[] = WTMP_FILENAME;
  610. ! #endif
  611.   #endif    /* USE_SYSV_UTMP */
  612.   
  613.   static char *get_ty;
  614. ***************
  615. *** 1130,1135 ****
  616. --- 1153,1161 ----
  617.       struct passwd *pw = NULL;
  618.   #ifdef UTMP
  619.       struct utmp utmp;
  620. + #ifdef LASTLOG
  621. +     struct lastlog lastlog;
  622. + #endif    /* LASTLOG */
  623.   #endif    /* UTMP */
  624.       extern int Exit();
  625.       char *getenv();
  626. ***************
  627. *** 1704,1718 ****
  628.                   (pw = getpwuid(screen->uid)) &&
  629.                   (i = open(etc_utmp, O_WRONLY)) >= 0) {
  630.                   bzero((char *)&utmp, sizeof(struct utmp));
  631. !                 (void) strcpy(utmp.ut_line, ttydev + strlen("/dev/"));
  632. !                 (void) strcpy(utmp.ut_name, pw->pw_name);
  633. !                 (void) strcpy(utmp.ut_host, 
  634. !                           XDisplayString (screen->display));
  635.                   time(&utmp.ut_time);
  636.                   lseek(i, (long)(tslot * sizeof(struct utmp)), 0);
  637.                   write(i, (char *)&utmp, sizeof(struct utmp));
  638.                   added_utmp_entry = True;
  639.                   close(i);
  640.               } else
  641.                   tslot = -tslot;
  642.           }
  643. --- 1730,1775 ----
  644.                   (pw = getpwuid(screen->uid)) &&
  645.                   (i = open(etc_utmp, O_WRONLY)) >= 0) {
  646.                   bzero((char *)&utmp, sizeof(struct utmp));
  647. !                 (void) strncpy(utmp.ut_line,
  648. !                            ttydev + strlen("/dev/"),
  649. !                            sizeof(utmp.ut_line));
  650. !                 (void) strncpy(utmp.ut_name, pw->pw_name,
  651. !                            sizeof(utmp.ut_name));
  652. !                 (void) strncpy(utmp.ut_host, 
  653. !                            XDisplayString (screen->display),
  654. !                            sizeof(utmp.ut_host));
  655.                   time(&utmp.ut_time);
  656.                   lseek(i, (long)(tslot * sizeof(struct utmp)), 0);
  657.                   write(i, (char *)&utmp, sizeof(struct utmp));
  658. +                 close(i);
  659.                   added_utmp_entry = True;
  660. + #ifdef WTMP
  661. +                 if (term->misc.login_shell &&
  662. +                 (i = open(etc_wtmp, O_WRONLY|O_APPEND)) >= 0) {
  663. +                     write(i, (char *)&utmp,
  664. +                     sizeof(struct utmp));
  665.                   close(i);
  666. +                 }
  667. + #endif /* WTMP */
  668. + #ifdef LASTLOG
  669. +                 if (term->misc.login_shell &&
  670. +                 (i = open(etc_lastlog, O_WRONLY)) >= 0) {
  671. +                     bzero((char *)&lastlog,
  672. +                     sizeof (struct lastlog));
  673. +                     (void) strncpy(lastlog.ll_line, ttydev +
  674. +                     sizeof("/dev"),
  675. +                     sizeof (lastlog.ll_line));
  676. +                     (void) strncpy(lastlog.ll_host, 
  677. +                       XDisplayString (screen->display),
  678. +                       sizeof (lastlog.ll_host));
  679. +                     time(&lastlog.ll_time);
  680. +                     lseek(i, (long)(screen->uid *
  681. +                     sizeof (struct lastlog)), 0);
  682. +                     write(i, (char *)&lastlog,
  683. +                     sizeof (struct lastlog));
  684. +                     close(i);
  685. +                 }
  686. + #endif /* LASTLOG */
  687.               } else
  688.                   tslot = -tslot;
  689.           }
  690. ***************
  691. *** 2020,2025 ****
  692. --- 2077,2092 ----
  693.           lseek(i, (long)(tslot * sizeof(struct utmp)), 0);
  694.           write(i, (char *)&utmp, sizeof(struct utmp));
  695.           close(i);
  696. + #ifdef WTMP
  697. +         if (term->misc.login_shell &&
  698. +             (i = open(etc_wtmp, O_WRONLY | O_APPEND)) >= 0) {
  699. +             (void) strncpy(utmp.ut_line, ttydev +
  700. +                 sizeof("/dev"), sizeof (utmp.ut_line));
  701. +             time(&utmp.ut_time);
  702. +             write(i, (char *)&utmp, sizeof(struct utmp));
  703. +             close(i);
  704. +         }
  705. + #endif /* WTMP */
  706.       }
  707.   #endif    /* USE_SYSV_UTMP */
  708.   #endif    /* UTMP */
  709. *** /tmp/,RCSt1a26856    Mon Jan  9 11:21:40 1989
  710. --- clients/xterm/misc.c    Mon Jan  9 11:21:40 1989
  711. ***************
  712. *** 1,5 ****
  713.   /*
  714. !  *    $XConsortium: misc.c,v 1.28 88/11/17 16:07:46 rws Exp $
  715.    */
  716.   
  717.   
  718. --- 1,5 ----
  719.   /*
  720. !  *    $XConsortium: misc.c,v 1.29 89/01/04 12:25:17 jim Exp $
  721.    */
  722.   
  723.   
  724. ***************
  725. *** 45,50 ****
  726. --- 45,51 ----
  727.   #include "wait.ic"
  728.   #include "waitmask.ic"
  729.   #include <X11/Shell.h>
  730. + #include <X11/Xmu.h>
  731.   
  732.   extern char *malloc();
  733.   extern char *mktemp();
  734. ***************
  735. *** 53,59 ****
  736.   extern void abort();
  737.   
  738.   #ifndef lint
  739. ! static char rcs_id[] = "$XConsortium: misc.c,v 1.28 88/11/17 16:07:46 rws Exp $";
  740.   #endif    /* lint */
  741.   
  742.   xevents()
  743. --- 54,60 ----
  744.   extern void abort();
  745.   
  746.   #ifndef lint
  747. ! static char rcs_id[] = "$XConsortium: misc.c,v 1.29 89/01/04 12:25:17 jim Exp $";
  748.   #endif    /* lint */
  749.   
  750.   xevents()
  751. ***************
  752. *** 880,893 ****
  753.   Display *d;
  754.   register XErrorEvent *ev;
  755.   {
  756. !         char buffer[BUFSIZ];
  757. !     XGetErrorText(d, ev->error_code, buffer, BUFSIZ);
  758. !     fprintf(stderr, "%s: %s\n", xterm_name, buffer);
  759. !     fprintf(stderr, "Request code %d, minor code %d, serial #%ld, resource id %ld\n",
  760. !      ev->request_code, ev->minor_code, ev->serial, (long)ev->resourceid);
  761. !         _cleanup();
  762. !         abort();
  763. ! /*    Exit(ERROR_XERROR); */
  764.   }
  765.   
  766.   /*ARGSUSED*/
  767. --- 881,889 ----
  768.   Display *d;
  769.   register XErrorEvent *ev;
  770.   {
  771. !     fprintf (stderr, "%s:  warning, error event receieved:\n", xterm_name);
  772. !     (void) XmuPrintDefaultErrorMessage (d, ev, stderr);
  773. !     Exit (ERROR_XERROR);
  774.   }
  775.   
  776.   /*ARGSUSED*/
  777. *** /tmp/,RCSt1a26917    Mon Jan  9 11:21:51 1989
  778. --- clients/xterm/screen.c    Mon Jan  9 11:21:52 1989
  779. ***************
  780. *** 1,5 ****
  781.   /*
  782. !  *    $XConsortium: screen.c,v 1.8 88/10/07 08:18:41 swick Exp $
  783.    */
  784.   
  785.   #include <X11/copyright.h>
  786. --- 1,5 ----
  787.   /*
  788. !  *    $XConsortium: screen.c,v 1.10 89/01/03 16:18:06 jim Exp $
  789.    */
  790.   
  791.   #include <X11/copyright.h>
  792. ***************
  793. *** 30,36 ****
  794.   /* screen.c */
  795.   
  796.   #ifndef lint
  797. ! static char rcs_id[] = "$XConsortium: screen.c,v 1.8 88/10/07 08:18:41 swick Exp $";
  798.   #endif    /* lint */
  799.   
  800.   #include <X11/Xlib.h>
  801. --- 30,36 ----
  802.   /* screen.c */
  803.   
  804.   #ifndef lint
  805. ! static char rcs_id[] = "$XConsortium: screen.c,v 1.10 89/01/03 16:18:06 jim Exp $";
  806.   #endif    /* lint */
  807.   
  808.   #include <X11/Xlib.h>
  809. ***************
  810. *** 382,395 ****
  811.   int width, height;
  812.   unsigned *flags;
  813.   {
  814. !     register int rows, cols;
  815.       register int index;
  816. !     register int savelines;
  817.       register ScrnBuf sb = screen->allbuf;
  818.       register ScrnBuf ab = screen->altbuf;
  819.       register int x;
  820. !     register int border = 2 * screen->border;
  821. !     register int i, j, k;
  822.   #ifdef sun
  823.   #ifdef TIOCSSIZE
  824.       struct ttysize ts;
  825. --- 382,395 ----
  826.   int width, height;
  827.   unsigned *flags;
  828.   {
  829. !     int rows, cols;
  830.       register int index;
  831. !     int savelines;
  832.       register ScrnBuf sb = screen->allbuf;
  833.       register ScrnBuf ab = screen->altbuf;
  834.       register int x;
  835. !     int border = 2 * screen->border;
  836. !     int i, j, k;
  837.   #ifdef sun
  838.   #ifdef TIOCSSIZE
  839.       struct ttysize ts;
  840. ***************
  841. *** 526,531 ****
  842. --- 526,532 ----
  843.       
  844.       screen->fullVwin.fullheight = height;
  845.       screen->fullVwin.fullwidth = width;
  846. +     ResizeSelection (screen, rows, cols);
  847.   #ifdef sun
  848.   #ifdef TIOCSSIZE
  849.       /* Set tty's idea of window size */
  850. *** /tmp/,RCSt1a26927    Mon Jan  9 11:21:55 1989
  851. --- clients/xterm/scrollbar.c    Mon Jan  9 11:21:56 1989
  852. ***************
  853. *** 1,5 ****
  854.   /*
  855. !  *    $XConsortium: scrollbar.c,v 1.16 88/10/07 08:19:51 swick Exp $
  856.    */
  857.   
  858.   #include <X11/copyright.h>
  859. --- 1,5 ----
  860.   /*
  861. !  *    $XConsortium: scrollbar.c,v 1.17 88/11/23 13:56:05 rws Exp $
  862.    */
  863.   
  864.   #include <X11/copyright.h>
  865. ***************
  866. *** 42,48 ****
  867.   extern void Bcopy();
  868.   
  869.   #ifndef lint
  870. ! static char rcs_id[] = "$XConsortium: scrollbar.c,v 1.16 88/10/07 08:19:51 swick Exp $";
  871.   #endif    /* lint */
  872.   
  873.   /* Event handlers */
  874. --- 42,48 ----
  875.   extern void Bcopy();
  876.   
  877.   #ifndef lint
  878. ! static char rcs_id[] = "$XConsortium: scrollbar.c,v 1.17 88/11/23 13:56:05 rws Exp $";
  879.   #endif    /* lint */
  880.   
  881.   /* Event handlers */
  882. ***************
  883. *** 179,195 ****
  884.       Widget sbw;
  885.       TScreen *screen;
  886.   {
  887. -     XSetWindowAttributes attr;
  888.       XtRealizeWidget (sbw);
  889. -     attr.do_not_propagate_mask = 
  890. -       LeaveWindowMask | EnterWindowMask | StructureNotifyMask;
  891. -     XChangeWindowAttributes(screen->display, XtWindow(sbw), 
  892. -                 CWDontPropagate, &attr);
  893. -     return;
  894.   }
  895.   
  896.   
  897. --- 179,185 ----
  898. *** /tmp/,RCSt1a27006    Mon Jan  9 11:22:12 1989
  899. --- clients/xterm/xterm.man    Mon Jan  9 11:22:15 1989
  900. ***************
  901. *** 337,343 ****
  902.   .TP 8
  903.   .B \-fn \fIfont\fP
  904.   This option specifies the font to be used for displaying normal text.  The
  905. ! default is ``vtsingle.''
  906.   .TP 8
  907.   .B \-name \fIname\fP
  908.   This option specifies the application name under which resources are to be
  909. --- 337,343 ----
  910.   .TP 8
  911.   .B \-fn \fIfont\fP
  912.   This option specifies the font to be used for displaying normal text.  The
  913. ! default is \fIfixed\fP.
  914.   .TP 8
  915.   .B \-name \fIname\fP
  916.   This option specifies the application name under which resources are to be
  917. ***************
  918. *** 410,417 ****
  919.   Specifies whether or not synthetic key and button events (generated using
  920.   the X protocol SendEvent request) should be interpreted or discarded.
  921.   The default is ``false'' meaning they are discarded.  Note that allowing
  922. ! such events creates a very large security hole (imagine someone sending
  923. ! your idle shell the key events for ``rm -fr *'').
  924.   .sp
  925.   .TP 8
  926.   .B "alwaysHighlight (\fPclass\fB AlwaysHighlight)"
  927. --- 410,416 ----
  928.   Specifies whether or not synthetic key and button events (generated using
  929.   the X protocol SendEvent request) should be interpreted or discarded.
  930.   The default is ``false'' meaning they are discarded.  Note that allowing
  931. ! such events creates a very large security hole.
  932.   .sp
  933.   .TP 8
  934.   .B "alwaysHighlight (\fPclass\fB AlwaysHighlight)"
  935. ***************
  936. *** 818,823 ****
  937. --- 817,830 ----
  938.   correctly (in the new colors), to minimize the probability of
  939.   spoofing.  You can also bring up the menu again and make sure that a check
  940.   mark appears next to the entry.
  941. + .PP
  942. + \fBSecure Keyboard\fP mode will be disabled automatically if your xterm
  943. + window becomes iconified (or otherwise unmapped), or if you start up
  944. + a reparenting window manager (that places a title bar or other decoration
  945. + around the window) while in \fBSecure Keyboard\fP mode.  (This is a
  946. + feature of the X protocol not easily overcome.)  When this happens,
  947. + the foreground and background colors will be switched back and the bell
  948. + will sound in warning.
  949.   .SH "CHARACTER CLASSES"
  950.   Clicking the middle mouse button twice in rapid succession will cause all
  951.   characters of the same class (e.g. letters, white space, punctuation) to be
  952. -- 
  953. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  954. Moderator of comp.sources.x
  955.